package cn.yx.framework.util;

/**
 * Created by Administrator on 2017/4/28.
 */
public class WebSocketClientUtil {//extends WebSocketClient {
//    public WebSocketClientUtil(URI serverUri, Draft draft) {
//        super(serverUri, draft);
//    }
//
//    public WebSocketClientUtil(URI serverURI) {
//        super(serverURI);
//    }
//
//    @Override
//    public void onOpen(ServerHandshake handshakedata) {
//        System.out.println("opened connection");
//        // if you plan to refuse connection based on ip or httpfields overload: onWebsocketHandshakeReceivedAsClient
//    }
//
//    @Override
//    public void onMessage(String message) {
//        System.out.println("received: " + message);
//    }
//
//    @Override
//    public void onFragment(Framedata fragment) {
//        System.out.println("received fragment: " + new String(fragment.getPayloadData().array()));
//    }
//
//    @Override
//    public void onClose(int code, String reason, boolean remote) {
//        // The codecodes are documented in class org.java_websocket.framing.CloseFrame
//        System.out.println("Connection closed by " + (remote ? "remote peer" : "us"));
//    }
//
//    @Override
//    public void onError(Exception ex) {
//        ex.printStackTrace();
//        // if the error is fatal then onClose will be called additionally
//    }
}
